package com.yitong.equipment.ui.adapter

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yitong.equipment.R
import com.yitong.equipment.entity.other.MallClassifyMultipleEntity

class ClassifyDetailAdapter(data :MutableList<MallClassifyMultipleEntity>): BaseMultiItemQuickAdapter<MallClassifyMultipleEntity, BaseViewHolder>(data) {
    init {
        addItemType(MallClassifyMultipleEntity.LAYOUT_TITLE, R.layout.item_mall_all_classify_title)
        addItemType(MallClassifyMultipleEntity.LAYOUT_DETAIL, R.layout.item_mall_all_classify_detail)
    }

    override fun convert(holder: BaseViewHolder, item: MallClassifyMultipleEntity) {
        when(item.itemType) {
            MallClassifyMultipleEntity.LAYOUT_TITLE->{
                holder.setText(R.id.tv_title,item.content?.name)
            }
            MallClassifyMultipleEntity.LAYOUT_DETAIL->{
                holder.setText(R.id.tv_city,item.content?.name)
            }
        }
    }
}